/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kleintjes.creational.factory_pattern.example_book1.factory;

import com.kleintjes.creational.factory_pattern.example_book1.Connection;
import com.kleintjes.creational.factory_pattern.example_book1.model.SecureMySqlConnection;
import com.kleintjes.creational.factory_pattern.example_book1.model.SecureOracleConnection;
import com.kleintjes.creational.factory_pattern.example_book1.model.SecureSqlServerConnection;

/**
 *
 * @author Hughan.Kleintjes.hughanK@gmail.com
 */
public class SecureFactory implements ConnectionFactory
{
    @Override
    public Connection createConnection(String type)
    {
        if(type.equals("Oracle"))
            return new SecureOracleConnection();
        else if(type.equals("SQL Server"))
            return new SecureSqlServerConnection();
        else
            return new SecureMySqlConnection();
    }
    
}
